#pragma once

#include <windows.h>
#include <gl\gl.h>
#include <gl\glu.h>
#include <cg\cg.h>
#include <cg\cggl.h>

#include "Texture.h"
#include "GlExtFactory.h"

class Framebuffer
{
private:
	UINT framebufferId;
	UINT textureId;
	UINT renderbufferId;

public:
	Framebuffer();
	~Framebuffer(void);

	bool Initialize(int width, int height, int bpp);
	void StartRenderToTexture();
	void FinishRenderToTexture();
	UINT GetTextureId();

	void AttachColorTexture(UINT textureId);
	void AttachDepthTexture(UINT textureId);
	void RestoreDepthRenderBuffer();
};
